package lex.util;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;

public class FvwmLayoutTest extends JFrame {
	private JPanel pane = null;

	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				FvwmLayoutTest app = new FvwmLayoutTest();
				app.setLocationRelativeTo(null);
				app.setVisible(true);
			}
		});
	}

	public FvwmLayoutTest() {
		super();
		initialize();
	}

	private void initialize() {
		this.setSize(300, 200);
		this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		this.setContentPane(getPane());
		this.setTitle("FvwmLayout Demo");
	}

	public JPanel getPane() {
		if (pane == null) {
			pane = new JPanel();
			pane.setLayout(new FvwmLayout(0, 0, 0));
			pane.add("left center 2", new JButton("LC2"));// , new Fvwm(
															// Fvwm.LEFT, 2,
															// Fvwm.CENTER ) );
			pane.add(new JButton("LT1"), new Fvwm(Fvwm.LEFT, 1, Fvwm.TOP));
			pane.add(new JButton("LB0"), new Fvwm(Fvwm.LEFT, 0, Fvwm.BOTTOM));
			pane.add(new JButton("LC3"), new Fvwm(Fvwm.LEFT, 3, Fvwm.CENTER));
			pane.add(new JButton("RC0"), new Fvwm(Fvwm.RIGHT, 0, Fvwm.CENTER));
			pane.add("top right 1", new JButton("RT1"));// , new Fvwm(
														// Fvwm.RIGHT, 1,
														// Fvwm.TOP ) );
			pane.add(new JButton("RB2"), new Fvwm(Fvwm.RIGHT, 2, Fvwm.BOTTOM));
			pane.add(new JButton("RC3"), new Fvwm(Fvwm.RIGHT, 3, Fvwm.CENTER));
		}
		return pane;
	}
}
